# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libcdio-paranoia
pkgver=10.2.2.0.1
_pkgver="10.2+2.0.1"
pkgrel=2
pkgdesc="CD paranoia on top of libcdio"
url="https://www.gnu.org/software/libcdio/"
arch="all"
license="GPL-2.0-or-later and LGPL-2.0-or-later"
makedepends="libcdio-dev autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/libcdio/libcdio-paranoia-$_pkgver.tar.bz2"
builddir="$srcdir/$pkgname-$_pkgver"

prepare() {
	default_prepare
	update_config_sub

	sed -i \
		-e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADER/' \
		-e "s/\$1+\$2/$pkgver/" \
		configure.ac
	autoreconf -i
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
c4a768d11e9f62038ca8081316596c89c7fee6a314229fb42e3999757fae172a5dc167175f60d555c2442266d34fce6ce627f4124e9f3a93d0456adb09ca91f0  libcdio-paranoia-10.2+2.0.1.tar.bz2
"
